using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Drawing.Text;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Web;
using System.IO;
using Possan.Graphics.Filters;

namespace Possan.Graphics
{


	public class SWFInformation
	{
		public int Width;
		public int Height;
		public int Version;
		public float Framerate;

		public SWFInformation()
		{
			Width = 0;
			Height = 0;
			Version = 0;
			Framerate = 0;
		}

		internal protected static SWFInformation FromSWFObject(FlashTools.SWFFile swf)
		{
			SWFInformation ret = new SWFInformation();
			ret.Framerate = swf.FrameRate;
			ret.Width = swf.FrameWidth;
			ret.Height = swf.FrameHeight;
			ret.Version = swf.Version;
			     return ret;
		}

		/// <summary>
		/// Returns information about a .SWF (Flash Swiff)-file
		/// </summary>
		/// <param name="filepath">Path to .SWF-file</param>
		/// <returns>SWF Information</returns>
		public static SWFInformation FromFile(string filepath)
		{
			     return SWFInformation.FromSWFObject(new FlashTools.SWFFile(filepath));
		}

		/// <summary>
		/// Returns information about a .SWF (Flash Swiff)-file
		/// </summary>
		/// <param name="filestream">.SWF-file stream</param>
		/// <returns>SWF Information</returns>
		public static SWFInformation FromStream(Stream filestream)
		{
			     return SWFInformation.FromSWFObject(new FlashTools.SWFFile(filestream));
		}

		/// <summary>
		/// Returns information about a .SWF (Flash Swiff)-file
		/// </summary>
		/// <param name="filedata">.SWF-file data</param>
		/// <returns>SWF Information</returns>
		public static SWFInformation FromBytes(byte[] filedata)
		{
			     return SWFInformation.FromSWFObject(new FlashTools.SWFFile(new MemoryStream(filedata)));
		}

	}

}





